package cn.zjweu.service.impl;

import cn.zjweu.mapper.CategoryMapper;
import cn.zjweu.pojo.Category;
import cn.zjweu.service.CategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class CategoryServiceImpl implements CategoryService {
    @Autowired
    private CategoryMapper categoryMapper;
    @Override
    public List<Category> getAllCategory() {
        return categoryMapper.getAllCategory();
    }

    @Override
    public List<Category> getLikeCategory(String name) {
        return categoryMapper.getLikeCategory(name);
    }

    @Override
    public int updateCategory(Category category) {
        return categoryMapper.updateCategory(category);
    }

    @Override
    public int addCategory(Category category) {
        return categoryMapper.addCategory(category);
    }

    @Override
    public int deleteCategory(int id) {
        return categoryMapper.deleteCategory(id);
    }

    @Override
    public List<Map<String, Object>> getCategory() {
        return categoryMapper.getCategory();
    }
}
